<script type="text/javascript">
  window.name = "Tear-off opener";
  //debugger;
  var query = location.search.substr(1);
  var qnodes = query.split('&');
  var fromSite = qnodes[1].substr(9);
  document.write('<iframe style="width:0px; height:0px; border: 0px" id="aras_item_opener" name="aras_item_opener" src="' + fromSite + '/t/mysite.txt"></iframe>');

      var width = "428";
      var height = "346";
      var top = (screen.availHeight - height) / 2;
      var left = (screen.availWidth - width) / 2;
      var features = "scrollbars=no,resizable=yes,status=no,width=" + width + ",height=" + height;

      features += ",left=" + left + ",top=" + top;

      var winName = 'Innovator' + location.hostname.replace(/\.|:|-|_/g,'');
      var d = new Date();
      winName += d.getHours() + 'h' + d.getMinutes() + 'm' + d.getSeconds() + 's';
      var inn_window = open("scripts/Innovator.aspx?" + qnodes[0], winName, features);

      try
      {
        inn_window.focus();
        inn_window.moveTo(left, top);
        inn_window.resizeTo(width, height);
      }
      catch (excep) {}

  function __openTearOffWindowFromSharePoint__(query)
  {
    //debugger;
    if (inn_window.top.aras)
    {
      var qnodes = query.substr(1).split('&');
      var inodes = qnodes[0].split(':');
      var itype = inodes[0].substr(10);
      itype = itype.replace( /%20/g, " " );
      var id = inodes[1];
      inn_window.top.aras.uiShowItem(itype, id, 'tab view', true);
    }
  }

</script>
